# Include the directory itself as a path to include directories
set( CMAKE_INCLUDE_CURRENT_DIR ON )

# Add requirements for external libraries
find_package( SDL REQUIRED )
find_package( SDL_net REQUIRED )
include_directories( ${SDL_INCLUDE_DIR} ${SDLNET_INCLUDE_DIR} )

# Create a variable containing all .cpp files
file( GLOB console_SOURCES *.cpp )

# Create a variable containing all .h files
file( GLOB console_HEADERS *.h )

# Create a library for this module
add_library( console ${console_SOURCES} ${console_HEADERS} ${console_LUA_TGTS} )

# Set up other dependencies
target_link_libraries( console ${CMAKE_DL_LIBS} )
target_link_libraries( console ${SDL_LIBRARY} ${SDLNET_LIBRARY} )

# Set up installation targets
install( FILES ${console_LUA_TGTS} DESTINATION bin/console )

